package com.jy.datapipeline.export.splitkey.utils;

/**
 * @类名 SqlUtil
 * @描述 TODO
 * @作者 白条君
 * @创建日期 2023/8/28 12:10
 * @版本 1.0
 */
public class SqlUtil {

    public static final String SPLIT_KEY = "#{splitKey}";

    public static final String MAX = "#{max}";

    public static final String MIN = "#{min}";

    public static final String SCHEMA = "#{schema}";

    public static final String TABLE = "#{table}";

    public static final String COUNT_ALIAS = "total_count";

    public static final String QUERY_COUNT_SQL = new StringBuilder()
            .append("select count(1) " + COUNT_ALIAS)
            .append(" from " + SCHEMA + "." + TABLE)
            .append(" where " + SPLIT_KEY + " >= " + MIN)
            .append(" and " + SPLIT_KEY + " < " + MAX).toString();
}